package com.example.testhiber.initPackage.business.test;


import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.example.testhiber.initPackage.business.Dictionaries.IdType;
import com.example.testhiber.initPackage.business.Dictionaries.Period;
import com.example.testhiber.initPackage.business.Dictionaries.TrackType;
import com.example.testhiber.initPackage.business.utils.JsoupUtils;
import com.example.testhiber.initPackage.business.utils.StringKit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;

public class test1 {
    private static final Logger logger = LoggerFactory.getLogger(test1.class);
    private static final String PATH="/test/";


    public static void main(String[] args) {

        List<String> pList = new ArrayList<>();
        pList.add("17605276801");
        pList.add("18136311322");
        pList.add("18262917166");
        pList.add("15061715585");
        pList.add("15850940788");
        pList.add("15250901494");
        pList.add("15240371833");
        pList.add("18005249851");
        pList.add("17768162988");
        pList.add("15850903612");
        pList.add("13515296193");
        pList.add("13485076790");

        List<String> list = new ArrayList<>();
        for(String s:pList){
            System.out.println("s:"+s);
            String res = JsoupUtils.getTitle(IdType.phone,s);
            if(!"".equals(StringKit.toString(res))){
                JSONArray jsonArray = JSONArray.parseArray(res);
                for (Object o:jsonArray){
                    JSONObject jsonObject = JSONObject.parseObject(StringKit.toString(o));
                    list.add(StringKit.toString(jsonObject.get("deviceId")));
                    System.out.println(StringKit.toString(jsonObject.get("deviceId")));
                }
            }
        }

        System.out.println("获取轨迹");
        for(String s:list){
            String res = JsoupUtils.getGj(s,"20200701"
                    ,"20200721", Period.ywgj, TrackType.LOCATION_0,
                    "1","99");//查询夜晚小区轨迹
            System.out.println("deviceid:"+s+"---"+res);
        }


//        [{"deviceId":"0ecf9b58ebd80bd6238b2e5be79967bbbd57c169","imei":"869011022948043","imsi":"","mac":"4a:45:b1:69:76:c4","phone":"13381176901","snsuid":null,"idfa":null,"time":1525536000},{"deviceId":"f7bf17bbff41dbb76432af7e6390d8925bc13efc","imei":"869011022948043","imsi":"","mac":"","phone":"13381176901","snsuid":null,"idfa":null,"time":1525536000}]
//        String res = JsoupUtils.getGj("63e799ad0404cd8ab4c6bcba59e7ff5cb3665f1e","20200720"
//                ,"20200721", Period.ywgj, TrackType.LOCATION_0,
//                "1","99");//查询夜晚小区轨迹
//        String res = JsoupUtils.getTxlFx("15295145983");
//        String res = JsoupUtils.getSjzh("a5de142b1690bc5df986b91e67ed91431331d20b","1","99");
//        String res = JsoupUtils.tjWifiCx("a5de142b1690bc5df986b91e67ed91431331d20b","1","99");
//        System.out.println(res);


    }

}